package shuashuami.hb.com.view;

import android.app.Activity;
import android.app.Dialog;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import shuashuami.hb.com.hbclient.R;
import shuashuami.hb.com.http.ZailaiyidanHttp;

/**
 * Created by Administrator on 2017/6/20.
 */

public class AddTaskDialog extends Dialog {

    private String id;
    private Activity activity;

    public AddTaskDialog(Activity context, String id) {
        super(context, R.style.Dialog);
        this.activity = context;
        this.id = id;
        setCustomDialog();
    }

    private void setCustomDialog() {
        View mView = LayoutInflater.from(getContext()).inflate(R.layout.add_task, null);
        Button btnCancle = (Button) mView.findViewById(R.id.btn_change_content_cancle);
        Button btnEnter = (Button) mView.findViewById(R.id.btn_change_content_enter);
        btnCancle.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });
        btnEnter.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                changeContent();
                dismiss();
            }
        });
        super.setContentView(mView);
    }

    private void changeContent() {
        ZailaiyidanHttp changeCUserMessageHttp = new ZailaiyidanHttp(activity, id);
        changeCUserMessageHttp.getMessage();
    }

    @Override
    public void setContentView(int layoutResID) {
    }

    @Override
    public void setContentView(View view, ViewGroup.LayoutParams params) {
    }

    @Override
    public void setContentView(View view) {
    }
}
